import {createStore} from 'vuex'
export default createStore({
	state:{
		loginStatus:false,
		phone:'',
		name:'微信用户',
		openId:'',
		avatar:'https://168809.oss-cn-hangzhou.aliyuncs.com/community/avatar.png',
		verify:2
	},
	mutations:{
		logout(state){
			state.loginStatus = false
			state.phone = ''
			state.name = '微信用户'
			state.openId = ''
			state.avatar = 'https://168809.oss-cn-hangzhou.aliyuncs.com/community/avatar.png'
			state.verify = 2
			uni.clearStorageSync()
		},
		setLoginInfo(state,usr){
			state.loginStatus = true
			state.name = usr.name
			state.openId = usr.openid
			state.avatar = usr.avatar
			state.verify = usr.verify
		},
		setVerify(state){
			state.verify = 1
		}
	}
})
